//前端接口

import request from '@/utils/request'

export function getStudents() {
    return request({
        url: '/Student/getStudents',  //后端接口，显示学生列表
        method: 'get'
    })
}

//删除
export function deleteStudents(sid) {
    return request({
        url: '/Student/deleteStudents?sid=' + sid,
        method: 'delete'
    })
}

//编辑
export function updateStudents(data) {
    return request({
        method: 'post',
        maxBodyLength: Infinity,
        url: '/Student/updateStudents',
        headers: {
            'sid': '1',
            'Content-Type': 'application/json'
        },
        data: data
    })
}

//通过sid查找学生信息
export function findStudentsById(sid) {
    return request({
        url: '/Student/findStudentsById?sid=' + sid,
        method: 'get',
    })
}

//添加学生表
export function addStudents(data) {
    return request({
        url: '/Student/addStudents',
        method: 'post',
        data: data
    })
}

//上传头像
export function upload(file) {
    return request({
        url: '/Student/upload',
        method: 'post',
        data: file,
    })
}


//批量删除
export function deleteStudentsByIds(data) {
    return request({
        url: '/Student/deleteStudentsByIds',
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    })
}

//模糊查询
export function findStudentsByIds(data) {
    return request({
        method: 'post',
        maxBodyLength: Infinity,
        url: '/Student/findStudentsByIds',
        headers: { 
          'sid': '1', 
          'Content-Type': 'application/json'
        },
        data : data
    })
}